<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'list.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/content.css">


<style type="text/css">
#down table {
	position: relative;
	left: 50%;
	margin-left: -250px;
	top: 50px;
	border-top: 1px #999 solid;
	border-right: 1px #999 solid;
}

table tr {
	height: 40px;
	color: #4C8FBD;
}

table tr td {
	border-left: 1px #999 solid;
	border-bottom: 1px #999 solid;
}
</style>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery-3.1.1.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/delete.js" charset="gb2312"></script>
</head>

<body>

	<div id="up">
		<ul>
			<li><span><a href="admin/welcome">平台首页 </a>&gt; 商品管理
					&gt;商品图片</span></li>
		</ul>
	</div>
	<div id="down">
		<table width="500px">
			<sf:form action="product/${product.id }/addimg" method="post"
				modelAttribute="product" enctype="multipart/form-data">
				<c:forEach items="${imgs }" var="img">
					<tr>
						<td><img src="<%=request.getContextPath()%>/image/${img.name }"
							height="300" width="300"></td>
					</tr>
					<tr>
						<td><a href="single-product.html">${img.name }</a></td>

						<td><a href="product/${img.id }/deleteimg" class="del">删除</a></td>
					</tr>
				</c:forEach>
				<td><input type="file" name="files" class="in" multiple>
					<input type="submit" value="添&nbsp;&nbsp;&nbsp;加" class="su">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				</td>
			</sf:form>
		</table>
	</div>
	<form action="" method="post">
		<input type="hidden" name="_method" value="DELETE">
	</form>

</body>
</html>
